<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="registrationDetail.title"/></title>
<content tag="heading"><fmt:message key="registrationDetail.heading"/></content>

<spring:bind path="registration.*">
    <c:if test="${not empty status.errorMessages}">
    <div class="error">
        <c:forEach var="error" items="${status.errorMessages}">
            <img src="<c:url value="/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
            <c:out value="${error}" escapeXml="false"/><br />
        </c:forEach>
    </div>
    </c:if>
</spring:bind>

<form:form commandName="registration" method="post" action="editRegistration.html" onsubmit="return validateRegistration(this)" id="registrationForm">
<ul>

<form:hidden path="id"/>

    <li>
        <icnmember:label styleClass="desc" key="registration.ticketNumbers"/>
        <form:errors path="ticketNumbers" cssClass="fieldError"/>
        <form:textarea path="ticketNumbers" id="ticketNumbers" cssClass="text medium" rows="3" cols="20"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.firstName"/>
        <form:errors path="firstName" cssClass="fieldError"/>
        <form:input path="firstName" id="firstName" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.lastName"/>
        <form:errors path="lastName" cssClass="fieldError"/>
        <form:input path="lastName" id="lastName" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.phone"/>
        <form:errors path="phone" cssClass="fieldError"/>
        <form:input path="phone" id="phone" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.email"/>
        <form:errors path="email" cssClass="fieldError"/>
        <form:input path="email" id="email" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.numberTickets"/>
        <form:errors path="numberTickets" cssClass="fieldError"/>
        <form:input path="numberTickets" id="numberTickets" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.numberKids"/>
        <form:errors path="numberKids" cssClass="fieldError"/>
        <form:input path="numberKids" id="numberKids" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.amtPaid"/>
        <form:errors path="amtPaid" cssClass="fieldError"/>
        <form:input path="amtPaid" id="amtPaid" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.paymentMethod"/>
        <form:errors path="paymentMethod" cssClass="fieldError"/>
        <form:input path="paymentMethod" id="paymentMethod" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.willAttend"/>
        <form:errors path="willAttend" cssClass="fieldError"/>
        <form:input path="willAttend" id="willAttend" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.notes"/>
        <form:errors path="notes" cssClass="fieldError"/>
        <form:input path="notes" id="notes" cssClass="text medium"/>
    </li>

    <li>
        <icnmember:label styleClass="desc" key="registration.salesPerson"/>
        <form:errors path="salesPerson" cssClass="fieldError"/>
        <form:input path="salesPerson" id="salesPerson" cssClass="text medium"/>
    </li>

    <li class="buttonBar bottom">
        <input type="submit" class="button" name="save"  onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
        <input type="submit" class="button" name="delete" onclick="bCancel=true;return confirmDelete('Registration')" value="<fmt:message key="button.delete"/>" />
        <input type="submit" class="button" name="cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>" />
    </li>
</ul>
</form:form>

<script type="text/javascript">
    Form.focusFirstElement($('registrationForm'));
</script>

<v:javascript formName="registration" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript"  src="<c:url value="/scripts/validator.jsp"/>"></script>
